import type { ITag } from '@/api/modules/esl/priceTag';
import type { Rule } from 'ant-design-vue/es/form';

const formObj: ITag = {
  tagId: '',
  tagCode: '',
  goodsId: '',
  templateId: '',
  mac: null,
  resolutionId: '',
  stationId: '',
  tagColor: '',
  bindMode: '',
  bindingTime: '',
  lastUpdateTime: '',
  lastOnlineTime: '',
  status: '',
  rssi: 0,
  refreshTimes: 0,
  imgSrc: '',
  soc: 0,
  centigrade: 0,
  power: 0,
  rate: 0,
  fwVersion: '',
  type: '',
  deptId: '',
  stationName: '',
  stationNum: '',
  goodsName: '',
  templateName: '',
  resolutionDesc: '',
  resolutionWidth: 0,
  resolutionHeight: 0,
  vlast: 0,
  location: '',
  alias: 'a',
  goodsList: [],
};
export const form = ref<ITag>({
  ...formObj,
});

export const formRef = ref();

export const resetForm = () => {
  form.value = {
    ...formObj,
  };
};
export const formRules: Record<keyof ITag, Rule[]> = {
  tagId: [],
  tagCode: [],
  goodsId: [],
  templateId: [],
  mac: [],
  resolutionId: [],
  stationId: [],
  tagColor: [],
  bindMode: [],
  bindingTime: [],
  lastUpdateTime: [],
  lastOnlineTime: [],
  status: [],
  rssi: [],
  refreshTimes: [],
  imgSrc: [],
  soc: [],
  centigrade: [],
  power: [],
  rate: [],
  fwVersion: [],
  type: [],
  deptId: [],
  stationName: [],
  stationNum: [],
  goodsName: [],
  templateName: [],
  resolutionDesc: [],
  resolutionWidth: [],
  resolutionHeight: [],
  vlast: [],
  light: [],
  location: [],
  alias: [],
  goodsList: [],
  store: [],
};
